/***************************************************************************
 *   Copyright (C) 2007 by saa   *
 *   root@saa   *
 ***************************************************************************/

#ifndef NEWSESSIONFORM_H
#define NEWSESSIONFORM_H

#include <QtGui>
#include <QHostInfo>

#include "ui_new_session_form.h"
#include "routeserver.h"


class NewSessionForm : public QDialog, private Ui::new_session_form
{
    Q_OBJECT
    public:
        NewSessionForm( QWidget * parent = 0);

    protected slots:
        void start();
        void addNewTargetClicked();
        void addNewTarget(const QHostInfo & hostInfo);
        void removeSelectedTarget();
        void saveLinkToDB();
        void removeLink();

    public slots:
        void logProgrammeMessage(const QString & message, const LogFlag::LogLevels LogLevel = LogFlag::Common);
        void changeTelnetClientLogLevel(const int state);
        void changeParserLogLevel(const int state);
        void changeDatabaseLogLevel(const int state);
        void changeLogLevel(const LogFlag::LogLevels LogLevel, const int state);
        void updateLogTextEdit();
        void showLinks(const LinkList & linkList);
        void tracerouteToTargetFinished();
        void telnetClientFinished();

    protected:

        QStatusBar * statusBar;
        QProgressBar * progressBar;

        bool started;
        int activeLookup;
        int targetCount;

        QList<LogMessage> logMessage;
        LogFlag::LogLevels m_logLevel;
        
    signals:
        void stop();
};

#endif
